	<script>
// 顶部tab+页面切换
import { defineComponent} from 'vue'
export default defineComponent({
	name: 'WeworkQr'
})
</script>
<script setup>
import {formatDate} from '@/utils'
import { reqCustomerList } from '@/api'
import { customerDataList } from '@/data'
import { deepClone, isEmpty, customerStatus } from '@/utils'
import MyIcon from '@/components/my-icon/index.vue'
import { toRaw } from '@vue/reactivity';
import { ref } from 'vue'
const total = ref(0)
const pageNo = ref(1)
const queryForm = ref({
	qrId: ''
})
const props = defineProps({
  form: {
    type: Object,
    default: {},
  },
})

const tableData = ref()

const getData = async(obj)=>{
	let queryForm = {
		external_userid:props.form.external_userid,
		userid:props.form.id,
	}
	console.log(props.form)
	const r = await reqCustomerList(queryForm)
	if (r){
		tableData.value = r.data.customerlist
		total.value = r.data.count
	}
	
}
getData()

const multipleTableRef = ref()
const multipleSelection = ref([])
const selectAll = ref(false)


const exportExcel = () => {
	console.log('导出excel')
}
const handleCurrentChange = (val) => {
	pageNo.value = val
	getData()
}
const handleSelectAll = () => {
	multipleTableRef.value.clearSelection()
	if (selectAll.value) {
		tableData.value.forEach((row) => {
			multipleTableRef.value.toggleRowSelection(row, undefined)
		})
	}
}

const handleSelectionChange = (val) => {
	multipleSelection.value = val
	if (multipleSelection.value.length == qrDataSetList.value.length) {
		selectAll.value = true
	} else {
		selectAll.value = false
	}
}
const emits = defineEmits(['showDetail'])
defineExpose({
  getData
});
</script>
<template>
<div>
  <el-table class="a-mt20 a-p2016 app-container-radius" ref="multipleTableRef" :data="tableData" style="width:100%"
					>
          <el-table-column label="所属员工" align="left">
          <template #default="scope">
						<div class="app-flex-left">
							<el-avatar class="cho-margin" shape="square" :size="30" :src="scope.row.staff_avatar" />
							<span class="app-gap-words-left">
								{{ scope.row.staff_name}}
							</span>
						</div>
          </template>
          </el-table-column>
           <el-table-column label="客户来源" prop="add_way" align="center">
          <!-- <template #default="scope">
						<div class="app-flex-left">
							<el-avatar class="cho-margin" shape="square" :size="30" :src="scope.row.avatar" />
							<span class="app-gap-words-left">
								{{ scope.row.name }}
							</span>
						</div>
          </template> -->
          </el-table-column>
          <el-table-column label="添加时间" prop="createtime" align="center"> 
				<!-- <template #default="scope">
				{{formatDate(scope.row.createtime, 'yyyy-MM-dd hh:mm')}}
				</template> -->
				

				</el-table-column>
           <!-- <el-table-column label="最近沟通时间" prop="createTime" align="center"> 
				<template #default="scope">
				{{formatDate(scope.row.createtime, 'yyyy-MM-dd hh:mm')}}
				</template> -->
				

				<!-- </el-table-column> -->

        </el-table>   
          	</div>
</template>
<style lang="scss">
@import url('../../../../../style/app-component.scss');
@import '../../../../../style/mixin.scss';
</style>